//
//  GRSlideView.h
//  SleepingElf
//
//  Created by karong on 2023/6/13.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@class GRSlideView;
@protocol GRSlideViewDelegate <NSObject>
@required
- (UIView *)slideView:(GRSlideView *)slideView viewForItemWithObject:(id)object;
@optional
- (void)slideView:(GRSlideView *)slideView didSelectWithObject:(id)object;

- (void)slideView:(GRSlideView *)slideView didEndDeceleratingWithObject:(id)object;
@end

@interface GRSlideView : UIView

@property (nonatomic, strong) UIScrollView *scrollView;

@property (nonatomic, assign) BOOL isSlide; // 是否輪播

@property (nonatomic, weak) id<GRSlideViewDelegate> delegate;
/**
 创建slideView
 @param frame 可视区域的frame
 @param lr 左右偏移
 @param tb 上下偏移
 @param width 每一模块的宽度
 @return slideView
 */
+ (instancetype)slideViewWithFrame:(CGRect)frame padding_left_right:(CGFloat)lr padding_top_bottom:(CGFloat)tb cellWidth:(CGFloat)width;

- (void)setDataArray:(NSArray *)array;

@end

NS_ASSUME_NONNULL_END
